<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>constructor的使用</title>
</head>

<body>
    <script>
        function Student() { }

        Student.prototype = {
            // 重新指回创造这个原型对象的构造函数，否则原来的原型对象被覆盖
            constructor: Student,
            sleep: function () { console.log('睡觉'); },
            study: function () { console.log('学习'); }
        }
    </script>
</body>

</html>